import server from '../utils/request'
export function getProducts(obj) {
    return server({
        method: "GET",
        url: "/api/manage/product/list",
        params: obj
    })
}
export function addProducts(data) {
    return server({
        method: "POST",
        url: "/api/manage/product/add",
        data
    })
}

export function updateProducts(data) {
    return server({
        method: "POST",
        url: "/api/manage/product/update",
        data
    })
}
export function getProductInfos(params) {
    return server({
        method: "GET",
        url: "/api/manage/product/info",
        params:{productId:params}
    })
}
export function psearchs(obj) {
    console.log(123,obj)
    return server({
        method: "GET",
        url: "/api/manage/product/search",
        params: obj
    })
}
export function getCategorys(obj) {
    return server({
        method: "GET",
        url: "/api/manage/category/list",
        params: obj
    })
}
export function updateCategorys(data) {
    return server({
        method: "POST",
        url: "/api/manage/category/update",
        data
    })
}
export function getCategorysons(params) {
    return server({
        method: "GET",
        url: "/api/manage/category/list",
        params
    })
}
export function addCategorys(data) {
    return server({
        method: "POST",
        url: "/api/manage/category/add",
        data
    })
}
// 根据分类ID获取分类getCategoryinfo
export function getCategoryinfo(params) {
    return server({
        method: "GET",
        url: "/api/manage/category/info",
        params:{categoryId:params}
    })
}


export function updateStatus(data) {
    return server({
        method: "POST",
        url: "/api/manage/product/updateStatus",
        data
    })
}


// 规格
export function getAttributes(params) {
    return server({
        url: "/api/manage/sysAttr/list",
        params
    })
}
export function delAttributes(data) {
    return server({
        method: "POST",
        url: "/api/manage/sysAttr/delete",
        data:{
            _id:data
        }
    })
}
export function updateAttributes(data) {
    return server({
        method: "POST",
        url: "/api/manage/sysAttr/update",
        data
    })
}
export function addAttributes(data) {
    return server({
        method: "POST",
        url: "/api/manage/sysAttr/add",
        data
    })
}
export function searchAttributes(params) {
    return server({
        url: "/api/manage/sysAttr/search",
        params
    })
}





